
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Introduction to atomman: System class &#8212; atomman 1.4.0 documentation</title>
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Introduction to atomman: Load and dump conversions" href="1.4._Load_and_dump_conversions.html" />
    <link rel="prev" title="Introduction to atomman: Atoms class" href="1.2._Atoms_class.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="1.4._Load_and_dump_conversions.html" title="Introduction to atomman: Load and dump conversions"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="1.2._Atoms_class.html" title="Introduction to atomman: Atoms class"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tutorials</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  
<style>
/* CSS for nbsphinx extension */

/* remove conflicting styling from Sphinx themes */
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt *,
div.nbinput.container div.input_area pre,
div.nboutput.container div.output_area pre,
div.nbinput.container div.input_area .highlight,
div.nboutput.container div.output_area .highlight {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

div.nbinput.container > div[class*=highlight],
div.nboutput.container > div[class*=highlight] {
    margin: 0;
}

div.nbinput.container div.prompt *,
div.nboutput.container div.prompt * {
    background: none;
}

div.nboutput.container div.output_area .highlight,
div.nboutput.container div.output_area pre {
    background: unset;
}

div.nboutput.container div.output_area div.highlight {
    color: unset;  /* override Pygments text color */
}

/* avoid gaps between output lines */
div.nboutput.container div[class*=highlight] pre {
    line-height: normal;
}

/* input/output containers */
div.nbinput.container,
div.nboutput.container {
    display: -webkit-flex;
    display: flex;
    align-items: flex-start;
    margin: 0;
    width: 100%;
}
@media (max-width: 540px) {
    div.nbinput.container,
    div.nboutput.container {
        flex-direction: column;
    }
}

/* input container */
div.nbinput.container {
    padding-top: 5px;
}

/* last container */
div.nblast.container {
    padding-bottom: 5px;
}

/* input prompt */
div.nbinput.container div.prompt pre {
    color: #307FC1;
}

/* output prompt */
div.nboutput.container div.prompt pre {
    color: #BF5B3D;
}

/* all prompts */
div.nbinput.container div.prompt,
div.nboutput.container div.prompt {
    width: 4.5ex;
    padding-top: 5px;
    position: relative;
    user-select: none;
}

div.nbinput.container div.prompt > div,
div.nboutput.container div.prompt > div {
    position: absolute;
    right: 0;
    margin-right: 0.3ex;
}

@media (max-width: 540px) {
    div.nbinput.container div.prompt,
    div.nboutput.container div.prompt {
        width: unset;
        text-align: left;
        padding: 0.4em;
    }
    div.nboutput.container div.prompt.empty {
        padding: 0;
    }

    div.nbinput.container div.prompt > div,
    div.nboutput.container div.prompt > div {
        position: unset;
    }
}

/* disable scrollbars on prompts */
div.nbinput.container div.prompt pre,
div.nboutput.container div.prompt pre {
    overflow: hidden;
}

/* input/output area */
div.nbinput.container div.input_area,
div.nboutput.container div.output_area {
    -webkit-flex: 1;
    flex: 1;
    overflow: auto;
}
@media (max-width: 540px) {
    div.nbinput.container div.input_area,
    div.nboutput.container div.output_area {
        width: 100%;
    }
}

/* input area */
div.nbinput.container div.input_area {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    /*background: #f5f5f5;*/
}

/* override MathJax center alignment in output cells */
div.nboutput.container div[class*=MathJax] {
    text-align: left !important;
}

/* override sphinx.ext.imgmath center alignment in output cells */
div.nboutput.container div.math p {
    text-align: left;
}

/* standard error */
div.nboutput.container div.output_area.stderr {
    background: #fdd;
}

/* ANSI colors */
.ansi-black-fg { color: #3E424D; }
.ansi-black-bg { background-color: #3E424D; }
.ansi-black-intense-fg { color: #282C36; }
.ansi-black-intense-bg { background-color: #282C36; }
.ansi-red-fg { color: #E75C58; }
.ansi-red-bg { background-color: #E75C58; }
.ansi-red-intense-fg { color: #B22B31; }
.ansi-red-intense-bg { background-color: #B22B31; }
.ansi-green-fg { color: #00A250; }
.ansi-green-bg { background-color: #00A250; }
.ansi-green-intense-fg { color: #007427; }
.ansi-green-intense-bg { background-color: #007427; }
.ansi-yellow-fg { color: #DDB62B; }
.ansi-yellow-bg { background-color: #DDB62B; }
.ansi-yellow-intense-fg { color: #B27D12; }
.ansi-yellow-intense-bg { background-color: #B27D12; }
.ansi-blue-fg { color: #208FFB; }
.ansi-blue-bg { background-color: #208FFB; }
.ansi-blue-intense-fg { color: #0065CA; }
.ansi-blue-intense-bg { background-color: #0065CA; }
.ansi-magenta-fg { color: #D160C4; }
.ansi-magenta-bg { background-color: #D160C4; }
.ansi-magenta-intense-fg { color: #A03196; }
.ansi-magenta-intense-bg { background-color: #A03196; }
.ansi-cyan-fg { color: #60C6C8; }
.ansi-cyan-bg { background-color: #60C6C8; }
.ansi-cyan-intense-fg { color: #258F8F; }
.ansi-cyan-intense-bg { background-color: #258F8F; }
.ansi-white-fg { color: #C5C1B4; }
.ansi-white-bg { background-color: #C5C1B4; }
.ansi-white-intense-fg { color: #A1A6B2; }
.ansi-white-intense-bg { background-color: #A1A6B2; }

.ansi-default-inverse-fg { color: #FFFFFF; }
.ansi-default-inverse-bg { background-color: #000000; }

.ansi-bold { font-weight: bold; }
.ansi-underline { text-decoration: underline; }


div.nbinput.container div.input_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight].math,
div.nboutput.container div.output_area.rendered_html,
div.nboutput.container div.output_area > div.output_javascript,
div.nboutput.container div.output_area:not(.rendered_html) > img{
    padding: 5px;
    margin: 0;
}

/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */
div.nbinput.container div.input_area > div[class^='highlight'],
div.nboutput.container div.output_area > div[class^='highlight']{
    overflow-y: hidden;
}

/* hide copybtn icon on prompts (needed for 'sphinx_copybutton') */
.prompt a.copybtn {
    display: none;
}

/* Some additional styling taken form the Jupyter notebook CSS */
div.rendered_html table {
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
  color: black;
  font-size: 12px;
  table-layout: fixed;
}
div.rendered_html thead {
  border-bottom: 1px solid black;
  vertical-align: bottom;
}
div.rendered_html tr,
div.rendered_html th,
div.rendered_html td {
  text-align: right;
  vertical-align: middle;
  padding: 0.5em 0.5em;
  line-height: normal;
  white-space: normal;
  max-width: none;
  border: none;
}
div.rendered_html th {
  font-weight: bold;
}
div.rendered_html tbody tr:nth-child(odd) {
  background: #f5f5f5;
}
div.rendered_html tbody tr:hover {
  background: rgba(66, 165, 245, 0.2);
}
</style>
<div class="section" id="Introduction-to-atomman:-System-class">
<h1>Introduction to atomman: System class<a class="headerlink" href="#Introduction-to-atomman:-System-class" title="Permalink to this headline">¶</a></h1>
<p><strong>Lucas M. Hale</strong>, <a class="reference external" href="mailto:lucas&#46;hale&#37;&#52;&#48;nist&#46;gov?Subject=ipr-demo">lucas<span>&#46;</span>hale<span>&#64;</span>nist<span>&#46;</span>gov</a>, <em>Materials Science and Engineering Division, NIST</em>.</p>
<p><a class="reference external" href="http://www.nist.gov/public_affairs/disclaimer.cfm">Disclaimers</a></p>
<div class="section" id="1.-Introduction">
<h2>1. Introduction<a class="headerlink" href="#1.-Introduction" title="Permalink to this headline">¶</a></h2>
<p>The System class represents an atomic system configuration by combining an <a class="reference external" href="1.2._Atoms_class.html">Atoms</a> object with a <a class="reference external" href="1.1._Box_class.html">Box</a> object. Additional System methods and attributes deal with boundary conditions and the interaction between the underlying Atoms and Box objects.</p>
<p><strong>NOTE</strong>: The underlying structure of Atoms changed with version 1.2 to be more efficient and easier to work with. Changes have been made to the System class to reflect this.</p>
<p><strong>Library Imports</strong></p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Standard Python libraries</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">copy</span> <span class="k">import</span> <span class="n">deepcopy</span>
<span class="kn">import</span> <span class="nn">datetime</span>

<span class="c1"># http://www.numpy.org/</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="c1"># https://github.com/usnistgov/atomman</span>
<span class="kn">import</span> <span class="nn">atomman</span> <span class="k">as</span> <span class="nn">am</span>
<span class="kn">import</span> <span class="nn">atomman.unitconvert</span> <span class="k">as</span> <span class="nn">uc</span>

<span class="c1"># Show atomman version</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;atomman version =&#39;</span><span class="p">,</span> <span class="n">am</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span>

<span class="c1"># Show date of Notebook execution</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Notebook executed on&#39;</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
atomman version = 1.4.0
Notebook executed on 2021-08-03
</pre></div></div>
</div>
</div>
<div class="section" id="2.-Basics">
<h2>2. Basics<a class="headerlink" href="#2.-Basics" title="Permalink to this headline">¶</a></h2>
<div class="section" id="2.1.-Initialization-Options">
<h3>2.1. Initialization Options<a class="headerlink" href="#2.1.-Initialization-Options" title="Permalink to this headline">¶</a></h3>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>atoms</strong> (<em>atomman.Atoms, optional</em>) The underlying Atoms object to build system around.</p></li>
<li><p><strong>box</strong> (<em>atomman.Box, optional</em>) The underlying box object to build system around.</p></li>
<li><p><strong>pbc</strong> (<em>tuple or list of bool, optional</em>) Indicates which of the dimensions related to the three box vectors are periodic. Default value is (True, True, True).</p></li>
<li><p><strong>scale</strong> (<em>bool, optional</em>) If True, atoms.pos will be scaled relative to the box. Default value is False.</p></li>
<li><p><strong>symbols</strong> (<em>tuple, optional</em>) A list of the element symbols for each atom atype. If len(symbols) is less than natypes, then missing values will be set to None. Default sets list with all None values.</p></li>
<li><p><strong>masses</strong> (<em>tuple, optional</em>) A list of the masses for each atom atype. If len(symbols) is less than natypes, then missing values will be set to None. Default sets list with all None values.</p></li>
<li><p><strong>model</strong> (<em>str or DataModelDict, optional</em>) File path or content of a JSON/XML data model containing all system information. Cannot be given with atoms, box or scale.</p></li>
<li><p><strong>safecopy</strong> (<em>bool, optional</em>) Flag indicating if values are to be copied before setting. For values given as objects, direct setting (False, default) may result in the System pointing to the original object. Using safecopy=True deep copies the objects before setting to avoid this. Note that safecopy=True may be considerably slower for large numbers of atoms and/or properties.</p></li>
</ul>
<p><strong>Note</strong>: Since the number of atoms associated with an Atoms object is constant and a System’s Atoms cannot be reassigned, the number of atoms in a System cannot be changed after initialization.</p>
<p>Initialization without parameters uses the default Atoms() and Box() initializers.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 1.000,  0.000,  0.000]
bvect =  [ 0.000,  1.000,  0.000]
cvect =  [ 0.000,  0.000,  1.000]
origin = [ 0.000,  0.000,  0.000]
natoms = 1
natypes = 1
symbols = (None,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
</pre></div></div>
</div>
<p>This combination of atoms and box lets you define systems for any unit cell.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Define a system for dc Si unit cell</span>
<span class="n">pos</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mf">0.00</span><span class="p">,</span> <span class="mf">0.00</span><span class="p">,</span> <span class="mf">0.00</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.50</span><span class="p">,</span> <span class="mf">0.50</span><span class="p">,</span> <span class="mf">0.00</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.50</span><span class="p">,</span> <span class="mf">0.00</span><span class="p">,</span> <span class="mf">0.50</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.00</span><span class="p">,</span> <span class="mf">0.50</span><span class="p">,</span> <span class="mf">0.50</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">],</span>
                <span class="p">[</span><span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">]])</span>
<span class="n">atoms</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Atoms</span><span class="p">(</span><span class="n">pos</span><span class="o">=</span><span class="n">pos</span><span class="p">)</span>

<span class="n">a</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">5.431</span><span class="p">,</span> <span class="s1">&#39;Å&#39;</span><span class="p">)</span>
<span class="n">box</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Box</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">a</span><span class="p">)</span>

<span class="c1"># Scale = True will unscale atoms.pos to absolute Cartesian coordinates</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">atoms</span><span class="o">=</span><span class="n">atoms</span><span class="p">,</span> <span class="n">box</span><span class="o">=</span><span class="n">box</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Si&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 5.431,  0.000,  0.000]
bvect =  [ 0.000,  5.431,  0.000]
cvect =  [ 0.000,  0.000,  5.431]
origin = [ 0.000,  0.000,  0.000]
natoms = 8
natypes = 1
symbols = (&#39;Si&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   2.716 |   2.716 |   0.000
      2 |       1 |   2.716 |   0.000 |   2.716
      3 |       1 |   0.000 |   2.716 |   2.716
      4 |       1 |   1.358 |   1.358 |   1.358
      5 |       1 |   1.358 |   4.073 |   4.073
      6 |       1 |   4.073 |   1.358 |   4.073
      7 |       1 |   4.073 |   4.073 |   1.358
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="3.-Built-in-Attributes">
<h2>3. Built-in Attributes<a class="headerlink" href="#3.-Built-in-Attributes" title="Permalink to this headline">¶</a></h2>
<p>Each System instance has these built-in attributes:</p>
<ul class="simple">
<li><p><strong>atoms</strong> (<em>atomman.Atoms</em>) the underlying <a class="reference external" href="1.2._Atoms_class.html">Atoms</a> object.</p></li>
<li><p><strong>natoms</strong> (<em>int</em>) is the number of atoms (same as system.atoms.natoms).</p></li>
<li><p><strong>atypes</strong> (<em>numpy.ndarray of int</em>) lists all unique atype values (same as system.atoms.atypes).</p></li>
<li><p><strong>natypes</strong> (<em>int</em>) is the number of unique atype values (same as system.atoms.natypes).</p></li>
<li><p><strong>box</strong> (<em>atomman.Box</em>) the underlying <a class="reference external" href="1.1._Box_class.html">Box</a> object.</p></li>
<li><p><strong>pbc</strong> (<em>numpy.ndarray of bool</em>) three Boolean values indicating which box directions are periodic.</p></li>
<li><p><strong>symbols</strong> (<em>tuple</em>) the element symbols associated with each atype.</p></li>
<li><p><strong>masses</strong> (<em>tuple</em>) the masses set for each atype, if needed. <em>Added version 1.3.0</em></p></li>
<li><p><strong>composition</strong> (<em>str</em>) composition description of elements and numbers. <em>Added version 1.2.7</em></p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.natoms -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atypes</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.natypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.symbols -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">symbols</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.masses -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">masses</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.composition -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">composition</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.pbc -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">pbc</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
system.natoms -&gt; 8
system.atypes -&gt; (1,)
system.natypes -&gt; 1
system.symbols -&gt; (&#39;Si&#39;,)
system.masses -&gt; (None,)
system.composition -&gt; Si
system.pbc -&gt; [ True  True  True]
</pre></div></div>
</div>
<p>The pbc values can be set during initialization and changed at any time afterwards.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;setting: system.pbc = [False, True, True]&#39;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">pbc</span> <span class="o">=</span> <span class="p">[</span><span class="kc">False</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="kc">True</span><span class="p">]</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.pbc -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">pbc</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;setting: system.pbc[0] = True&#39;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">pbc</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.pbc -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">pbc</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
setting: system.pbc = [False, True, True]
system.pbc -&gt; [False  True  True]

setting: system.pbc[0] = True
system.pbc -&gt; [ True  True  True]
</pre></div></div>
</div>
<p>The underlying Atoms and Box objects can be directly retrieved. Note that</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.box -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
system.atoms -&gt;
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   2.716 |   2.716 |   0.000
      2 |       1 |   2.716 |   0.000 |   2.716
      3 |       1 |   0.000 |   2.716 |   2.716
      4 |       1 |   1.358 |   1.358 |   1.358
      5 |       1 |   1.358 |   4.073 |   4.073
      6 |       1 |   4.073 |   1.358 |   4.073
      7 |       1 |   4.073 |   4.073 |   1.358

system.box -&gt;
avect =  [ 5.431,  0.000,  0.000]
bvect =  [ 0.000,  5.431,  0.000]
cvect =  [ 0.000,  0.000,  5.431]
origin = [ 0.000,  0.000,  0.000]
</pre></div></div>
</div>
<p>Symbols can be updated at any time by supplying a list/tuple. For atype values not associated with a symbol, use None for the symbol. Note that symbols is stored as a tuple and therefore must all be set at once.</p>
<p><em>Update 1.3.0</em> How atypes, natypes, composition and symbols are handled has been changed to allow for mismatches between assigned atype values and symbols lists. Backwards compatibility will be affected if previous System.atoms had atype values of 0 or non-sequential atype values.</p>
<ul class="simple">
<li><p>Values for System.atoms.atype are limited to being ≥ 1.</p></li>
<li><p>System.atoms.natypes is max(System.atoms.atype)</p></li>
<li><p>System.natypes is the greater of System.atoms.natypes or len(System.symbols).</p></li>
<li><p>If System.symbols or System.atoms.atype values are changed such that System.atoms.natypes &gt; len(System.symbols), then System.symbols is expanded with None values.</p></li>
<li><p>The composition string will be generated if all used atype values are assigned symbols. Otherwise, System.composition will return None.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># More symbols can be assigned to the system than there are atype values</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;setting: system.symbols = [&#39;Si&#39;, &#39;Ge&#39;]&quot;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">symbols</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Ge&#39;</span><span class="p">,</span> <span class="s1">&#39;Si&#39;</span><span class="p">]</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.symbols -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">symbols</span><span class="p">)</span>

<span class="c1"># This change is reflected by system.atypes and system.natypes</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.natypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atypes</span><span class="p">)</span>

<span class="c1"># BUT, not by System.atoms.atypes and natypes! They are still based on atype values alone!</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">CAUTION!&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atoms.natypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atoms.atypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">atypes</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
setting: system.symbols = [&#39;Si&#39;, &#39;Ge&#39;]
system.symbols -&gt; (&#39;Ge&#39;, &#39;Si&#39;)
system.natypes -&gt; 2
system.atypes -&gt; (1, 2)

CAUTION!
system.atoms.natypes -&gt; 1
system.atoms.atypes -&gt; (1,)
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Symbols can be reset to remove the extra</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;setting: system.symbols = &#39;Ge&#39;&quot;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">symbols</span> <span class="o">=</span> <span class="s1">&#39;Ge&#39;</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.symbols -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">symbols</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.natypes -&gt;&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">natypes</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
setting: system.symbols = &#39;Ge&#39;
system.symbols -&gt; (&#39;Ge&#39;,)
system.natypes -&gt; 1
</pre></div></div>
</div>
</div>
<div class="section" id="4.-Scaling-Additions">
<h2>4. Scaling Additions<a class="headerlink" href="#4.-Scaling-Additions" title="Permalink to this headline">¶</a></h2>
<p>Since atomic positions are stored in absolute Cartesian coordinates, the system has methods for scaling/unscaling vectors relative to the box and which modify methods and attributes of the underlying Atoms and Box classes.</p>
<div class="section" id="4.1.-scale()-and-unscale()">
<h3>4.1. scale() and unscale()<a class="headerlink" href="#4.1.-scale()-and-unscale()" title="Permalink to this headline">¶</a></h3>
<p>The scale() and unscale() methods will convert any 3D vectors between the absolute Cartesian and relative box coordinates.</p>
<ul class="simple">
<li><p>scale() is for absolute Cartesian -&gt; relative box coordinates.</p></li>
<li><p>unscale() is for relative box -&gt; absolute Cartesian coordinates.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[9]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Scale the position vectors</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;setting: spos = system.scale(system.atoms.pos)&quot;</span><span class="p">)</span>
<span class="n">spos</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">scale</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;spos -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">spos</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># Unscale the scaled position vectors</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;setting: pos = system.unscale(spos)&quot;</span><span class="p">)</span>
<span class="n">pos</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">unscale</span><span class="p">(</span><span class="n">spos</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;pos -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">pos</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
setting: spos = system.scale(system.atoms.pos)
spos -&gt;
[[0.   0.   0.  ]
 [0.5  0.5  0.  ]
 [0.5  0.   0.5 ]
 [0.   0.5  0.5 ]
 [0.25 0.25 0.25]
 [0.25 0.75 0.75]
 [0.75 0.25 0.75]
 [0.75 0.75 0.25]]

setting: pos = system.unscale(spos)
pos -&gt;
[[0.      0.      0.     ]
 [2.7155  2.7155  0.     ]
 [2.7155  0.      2.7155 ]
 [0.      2.7155  2.7155 ]
 [1.35775 1.35775 1.35775]
 [1.35775 4.07325 4.07325]
 [4.07325 1.35775 4.07325]
 [4.07325 4.07325 1.35775]]
</pre></div></div>
</div>
</div>
<div class="section" id="4.2.-atoms_prop()">
<h3>4.2. atoms_prop()<a class="headerlink" href="#4.2.-atoms_prop()" title="Permalink to this headline">¶</a></h3>
<p>The atoms_prop() method extends the <a class="reference external" href="1.2._Atoms_class.html">atoms.prop()</a> method by adding a scale parameter option.</p>
<ul class="simple">
<li><p>scale=False (default): the property values are returned exactly as they are stored, i.e. this is the same as calling system.atoms.prop().</p></li>
<li><p>scale=True: the property values are automatically scaled/unscaled to/from box relative coordinates. This is convenient as you don’t have to remember which scale()/unscale() to use.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[10]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Using atoms_prop() with scale=False is the same as accessing atoms.prop</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Setting: system.atoms_prop(key=&#39;pos&#39;, index=2, value=[3,3,3])&quot;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="p">[</span><span class="mi">3</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">3</span><span class="p">])</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms.pos[2] -&gt;                    &quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, 2) -&gt;            &quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, 2, scale=True) -&gt;&quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># Using atoms_prop(scale=True) properly handles scaling/unscaling</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Setting: system.atoms_prop(key=&#39;pos&#39;, index=2, value=[0.5,0.0,0.5], scale=True)&quot;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="p">[</span><span class="mf">0.5</span><span class="p">,</span><span class="mf">0.0</span><span class="p">,</span><span class="mf">0.5</span><span class="p">],</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms.pos[2] -&gt;                    &quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, 2) -&gt;            &quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, 2, scale=True) -&gt;&quot;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Setting: system.atoms_prop(key=&#39;pos&#39;, index=2, value=[3,3,3])
system.atoms.pos[2] -&gt;                     [3. 3. 3.]
system.atoms_prop(&#39;pos&#39;, 2) -&gt;             [3. 3. 3.]
system.atoms_prop(&#39;pos&#39;, 2, scale=True) -&gt; [0.55238446 0.55238446 0.55238446]

Setting: system.atoms_prop(key=&#39;pos&#39;, index=2, value=[0.5,0.0,0.5], scale=True)
system.atoms.pos[2] -&gt;                     [2.7155 0.     2.7155]
system.atoms_prop(&#39;pos&#39;, 2) -&gt;             [2.7155 0.     2.7155]
system.atoms_prop(&#39;pos&#39;, 2, scale=True) -&gt; [0.5 0.  0.5]

</pre></div></div>
</div>
</div>
<div class="section" id="4.3.-atoms_df()">
<h3>4.3. atoms_df()<a class="headerlink" href="#4.3.-atoms_df()" title="Permalink to this headline">¶</a></h3>
<p>The atoms_df() method extends the <a class="reference external" href="1.2._Atoms_class.html">atoms.df()</a> method with an optional scale parameter.</p>
<ul class="simple">
<li><p>scale=False (defaut): the property values are returned exactly as they are stored, i.e. this is the same as calling system.atoms.df()</p></li>
<li><p>scale=True: the pos values will be scaled to box relative coordinates and all other parameters returned exactly as they are stored.</p></li>
<li><p>scale=list of property names: all listed property values will be scaled to box relative coordinates.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[11]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># With scale=False</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[11]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.00000</td>
      <td>0.00000</td>
      <td>0.00000</td>
    </tr>
    <tr>
      <td>1</td>
      <td>1</td>
      <td>2.71550</td>
      <td>2.71550</td>
      <td>0.00000</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>2.71550</td>
      <td>0.00000</td>
      <td>2.71550</td>
    </tr>
    <tr>
      <td>3</td>
      <td>1</td>
      <td>0.00000</td>
      <td>2.71550</td>
      <td>2.71550</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>1.35775</td>
      <td>1.35775</td>
      <td>1.35775</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>1.35775</td>
      <td>4.07325</td>
      <td>4.07325</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>4.07325</td>
      <td>1.35775</td>
      <td>4.07325</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>4.07325</td>
      <td>4.07325</td>
      <td>1.35775</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># With scale=True</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">(</span><span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.00</td>
      <td>0.00</td>
      <td>0.00</td>
    </tr>
    <tr>
      <td>1</td>
      <td>1</td>
      <td>0.50</td>
      <td>0.50</td>
      <td>0.00</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>0.50</td>
      <td>0.00</td>
      <td>0.50</td>
    </tr>
    <tr>
      <td>3</td>
      <td>1</td>
      <td>0.00</td>
      <td>0.50</td>
      <td>0.50</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.25</td>
      <td>0.25</td>
      <td>0.25</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>0.25</td>
      <td>0.75</td>
      <td>0.75</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>0.75</td>
      <td>0.25</td>
      <td>0.75</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.75</td>
      <td>0.75</td>
      <td>0.25</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[13]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># With scale=[&#39;pos&#39;]</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms_df</span><span class="p">(</span><span class="n">scale</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;pos&#39;</span><span class="p">])</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[13]:
</pre></div>
</div>
<div class="output_area rendered_html docutils container">
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>atype</th>
      <th>pos[0]</th>
      <th>pos[1]</th>
      <th>pos[2]</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>0</td>
      <td>1</td>
      <td>0.00</td>
      <td>0.00</td>
      <td>0.00</td>
    </tr>
    <tr>
      <td>1</td>
      <td>1</td>
      <td>0.50</td>
      <td>0.50</td>
      <td>0.00</td>
    </tr>
    <tr>
      <td>2</td>
      <td>1</td>
      <td>0.50</td>
      <td>0.00</td>
      <td>0.50</td>
    </tr>
    <tr>
      <td>3</td>
      <td>1</td>
      <td>0.00</td>
      <td>0.50</td>
      <td>0.50</td>
    </tr>
    <tr>
      <td>4</td>
      <td>1</td>
      <td>0.25</td>
      <td>0.25</td>
      <td>0.25</td>
    </tr>
    <tr>
      <td>5</td>
      <td>1</td>
      <td>0.25</td>
      <td>0.75</td>
      <td>0.75</td>
    </tr>
    <tr>
      <td>6</td>
      <td>1</td>
      <td>0.75</td>
      <td>0.25</td>
      <td>0.75</td>
    </tr>
    <tr>
      <td>7</td>
      <td>1</td>
      <td>0.75</td>
      <td>0.75</td>
      <td>0.25</td>
    </tr>
  </tbody>
</table>
</div></div>
</div>
</div>
<div class="section" id="4.4.-box_set()">
<h3>4.4. box_set()<a class="headerlink" href="#4.4.-box_set()" title="Permalink to this headline">¶</a></h3>
<p>The box_set() method extends the <a class="reference external" href="1.1._Box_class.html">box.set()</a> method to include an optional scale parameter. This is necessary to define how atomic positions are affected by the change in box dimensions.</p>
<ul class="simple">
<li><p>scale=False (defaut): the absolute Cartesian coordinates of the atoms are held fixed as the box is changed. This is equivalent to calling box.set() directly.</p></li>
<li><p>scale=True: the relative box coordinates of the atoms are held fixed by scaling the Cartesian coordinates as the box is changed.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[14]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># With scale=False, Cartesian coordinates are unchanged,</span>
<span class="n">newa</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">5.658</span><span class="p">,</span> <span class="s1">&#39;Å&#39;</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">box_set</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">newa</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">newa</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">newa</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># while box relative coordinates are changed</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, scale=True) =&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 5.658,  0.000,  0.000]
bvect =  [ 0.000,  5.658,  0.000]
cvect =  [ 0.000,  0.000,  5.658]
origin = [ 0.000,  0.000,  0.000]
natoms = 8
natypes = 1
symbols = (&#39;Ge&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   2.716 |   2.716 |   0.000
      2 |       1 |   2.716 |   0.000 |   2.716
      3 |       1 |   0.000 |   2.716 |   2.716
      4 |       1 |   1.358 |   1.358 |   1.358
      5 |       1 |   1.358 |   4.073 |   4.073
      6 |       1 |   4.073 |   1.358 |   4.073
      7 |       1 |   4.073 |   4.073 |   1.358

system.atoms_prop(&#39;pos&#39;, scale=True) =
[[0.         0.         0.        ]
 [0.47993991 0.47993991 0.        ]
 [0.47993991 0.         0.47993991]
 [0.         0.47993991 0.47993991]
 [0.23996995 0.23996995 0.23996995]
 [0.23996995 0.71990986 0.71990986]
 [0.71990986 0.23996995 0.71990986]
 [0.71990986 0.71990986 0.23996995]]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Return to original box</span>
<span class="n">system</span><span class="o">.</span><span class="n">box_set</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">a</span><span class="p">)</span>

<span class="c1"># With scale=True, Cartesian coordinates change,</span>
<span class="n">system</span><span class="o">.</span><span class="n">box_set</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">newa</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">newa</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">newa</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># while box relative coordinates are unchanged.</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms_prop(&#39;pos&#39;, scale=True) =&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 5.658,  0.000,  0.000]
bvect =  [ 0.000,  5.658,  0.000]
cvect =  [ 0.000,  0.000,  5.658]
origin = [ 0.000,  0.000,  0.000]
natoms = 8
natypes = 1
symbols = (&#39;Ge&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   2.829 |   2.829 |   0.000
      2 |       1 |   2.829 |   0.000 |   2.829
      3 |       1 |   0.000 |   2.829 |   2.829
      4 |       1 |   1.414 |   1.414 |   1.414
      5 |       1 |   1.414 |   4.244 |   4.244
      6 |       1 |   4.244 |   1.414 |   4.244
      7 |       1 |   4.244 |   4.244 |   1.414

system.atoms_prop(&#39;pos&#39;, scale=True) =
[[0.   0.   0.  ]
 [0.5  0.5  0.  ]
 [0.5  0.   0.5 ]
 [0.   0.5  0.5 ]
 [0.25 0.25 0.25]
 [0.25 0.75 0.75]
 [0.75 0.25 0.75]
 [0.75 0.75 0.25]]
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="5.-Built-in-manipulations">
<h2>5. Built-in manipulations<a class="headerlink" href="#5.-Built-in-manipulations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="5.1.-wrap()">
<h3>5.1. wrap()<a class="headerlink" href="#5.1.-wrap()" title="Permalink to this headline">¶</a></h3>
<p>The wrap method adjusts the atoms and box to ensure that all atomic positions are contained within the box. For atoms with positions beyond the box boundaries:</p>
<ul class="simple">
<li><p>If the boundary condition is periodic (as defined in pbc) then the atom’s position is folded to an equivalent position within the boundaries for that dimension.</p></li>
<li><p>If the boundary condition is non-periodic, the boundary is adjusted to encompass the atom.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[16]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Generate ten atom system with atoms between 0 and 10 and box boundaries 0 and 1</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">atoms</span><span class="o">=</span><span class="n">am</span><span class="o">.</span><span class="n">Atoms</span><span class="p">(</span><span class="n">pos</span><span class="o">=</span><span class="mi">10</span><span class="o">*</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">3</span><span class="p">)))</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 1.000,  0.000,  0.000]
bvect =  [ 0.000,  1.000,  0.000]
cvect =  [ 0.000,  0.000,  1.000]
origin = [ 0.000,  0.000,  0.000]
natoms = 10
natypes = 1
symbols = (None,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   3.162 |   6.211 |   1.950
      1 |       1 |   8.674 |   0.559 |   7.718
      2 |       1 |   7.439 |   0.502 |   8.636
      3 |       1 |   5.279 |   9.833 |   1.349
      4 |       1 |   4.218 |   1.356 |   2.301
      5 |       1 |   8.616 |   3.619 |   5.798
      6 |       1 |   0.905 |   8.565 |   8.355
      7 |       1 |   9.889 |   5.258 |   3.850
      8 |       1 |   8.874 |   5.331 |   1.700
      9 |       1 |   6.707 |   4.164 |   4.582
</pre></div></div>
</div>
<p>Atoms are wrapped around periodic boundaries, and non-periodic boundaries are extended to encompass all atoms.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[17]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Simple example with mixed periodic and non-periodic boundaries</span>
<span class="n">system</span><span class="o">.</span><span class="n">pbc</span> <span class="o">=</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
<span class="n">system</span><span class="o">.</span><span class="n">wrap</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 1.000,  0.000,  0.000]
bvect =  [ 0.000,  9.834,  0.000]
cvect =  [ 0.000,  0.000,  1.000]
origin = [ 0.000,  0.000,  0.000]
natoms = 10
natypes = 1
symbols = (None,)
pbc = [ True False  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.162 |   6.211 |   0.950
      1 |       1 |   0.674 |   0.559 |   0.718
      2 |       1 |   0.439 |   0.502 |   0.636
      3 |       1 |   0.279 |   9.833 |   0.349
      4 |       1 |   0.218 |   1.356 |   0.301
      5 |       1 |   0.616 |   3.619 |   0.798
      6 |       1 |   0.905 |   8.565 |   0.355
      7 |       1 |   0.889 |   5.258 |   0.850
      8 |       1 |   0.874 |   5.331 |   0.700
      9 |       1 |   0.707 |   4.164 |   0.582
</pre></div></div>
</div>
</div>
<div class="section" id="5.2.-normalize()">
<h3>5.2. normalize()<a class="headerlink" href="#5.2.-normalize()" title="Permalink to this headline">¶</a></h3>
<p>The box vectors for a system may not be compatible with certain codes, such as LAMMPS. The normalize() method helps with this by converting incompatible systems to a compatible representation.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>style</strong> (<em>str, optional</em>) Indicates the normalization style to use. Default (and only current option) is ‘lammps’.</p></li>
<li><p><strong>return_transform</strong> (<em>bool, optional</em>) Indicates if the transformation matrix associated with the normalization is to be returned. Default value is False.</p></li>
</ul>
<p>For style=‘lammps’, the system is altered so that the returned system has:</p>
<ol class="arabic simple">
<li><p>Right-handed box vectors.</p></li>
<li><p>avect = [lx, 0.0, 0.0]</p></li>
<li><p>bvect = [xy, ly, 0.0]</p></li>
<li><p>cvect = [xz, yz, lz]</p></li>
<li><p>All atoms initially inside the box dimensions.</p></li>
</ol>
<p><strong>Note</strong>: large box tilt factors are not adjusted with this function. As such, the LAMMPS command ‘box tilt large’ may be needed.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[18]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Define a system with random box vectors</span>
<span class="n">box</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Box</span><span class="p">(</span><span class="n">vects</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">3</span><span class="p">))</span>
<span class="n">atoms</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Atoms</span><span class="p">(</span><span class="n">pos</span><span class="o">=</span><span class="p">[[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">]])</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">atoms</span><span class="o">=</span><span class="n">atoms</span><span class="p">,</span> <span class="n">box</span><span class="o">=</span><span class="n">box</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;a =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">a</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;b =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">b</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;c =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">c</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;alpha =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">alpha</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;beta =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">beta</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;gamma =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">gamma</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 0.248,  0.204,  0.796]
bvect =  [ 0.435,  0.660,  0.796]
cvect =  [ 0.188,  0.630,  0.385]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (None,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   0.436 |   0.747 |   0.989
a = 0.8586100772316914
b = 1.1218347608798915
c = 0.7625630034164564
alpha = 19.804354324501812
beta = 42.54725061072815
gamma = 24.513806827840508
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[19]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Normalize box and show that lattice parameters and box relative positions are unchanged</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">normalize</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;a =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">a</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;b =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">b</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;c =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">c</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;alpha =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">alpha</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;beta =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">beta</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;gamma =&#39;</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">gamma</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Box relative positions:&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms_prop</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s1">&#39;pos&#39;</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 0.859,  0.000,  0.000]
bvect =  [ 1.021,  0.465,  0.000]
cvect =  [ 0.562,  0.497,  0.137]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (None,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   1.221 |   0.481 |   0.068
a = 0.8586100772316914
b = 1.1218347608798915
c = 0.7625630034164564
alpha = 19.804354324501798
beta = 42.54725061072814
gamma = 24.513806827840494
Box relative positions:
[[0.  0.  0. ]
 [0.5 0.5 0.5]]
</pre></div></div>
</div>
</div>
<div class="section" id="5.3.-rotate()">
<h3>5.3. rotate()<a class="headerlink" href="#5.3.-rotate()" title="Permalink to this headline">¶</a></h3>
<p>The System class also has a built-in rotate() method that can be used to rotate the system to a new orientation. The rotated system will be expanded to retain periodicity across its boundaries.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>uvws</strong> (<em>array-like object</em>) 3x3 array of three [uvw] Miller crystal vectors or 3x4 array of three [uvtw] Miller-Bravais hexagonal crystal vectors relative to the original system. These must define full Miller vectors, i.e. all u, v, w values be integers. These crystal vectors will align with the rotated system’s box vectors.</p></li>
<li><p><strong>tol</strong> (<em>float, optional</em>) Tolerance parameter used in rounding atomic positions near the boundaries to the boundary values. In box-relative coordinates, any atomic positions within tol of 0 or 1 will be rounded to 0 or 1, respectively. Default value is 1e-5.</p></li>
<li><p><strong>return_transform</strong> (<em>bool, optional</em>) Indicates if the transformation matrix associated with the normalization is to be returned. Default value is False.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p><strong>newsystem</strong> (<em>atomman.System</em>) a new System based on rotating and expanding the original.</p></li>
<li><p><strong>transform</strong> (<em>numpy.ndarray</em>) the transformation matrix associated with the rotation. Returned if return_transform is True.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[20]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Define a bcc unit cell for vanadium</span>
<span class="n">alat</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">3.03</span><span class="p">,</span> <span class="s1">&#39;Å&#39;</span><span class="p">)</span>
<span class="n">box</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Box</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="n">alat</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="n">alat</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">alat</span><span class="p">)</span>
<span class="n">atoms</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">Atoms</span><span class="p">(</span><span class="n">pos</span><span class="o">=</span><span class="p">[[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">]])</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">atoms</span><span class="o">=</span><span class="n">atoms</span><span class="p">,</span> <span class="n">box</span><span class="o">=</span><span class="n">box</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;V&#39;</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 3.030,  0.000,  0.000]
bvect =  [ 0.000,  3.030,  0.000]
cvect =  [ 0.000,  0.000,  3.030]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   1.515 |   1.515 |   1.515
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[21]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Rotate the system to coincide with the following crystal vectors</span>
<span class="n">a_uvw</span> <span class="o">=</span> <span class="p">[</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span>
<span class="n">b_uvw</span> <span class="o">=</span> <span class="p">[</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
<span class="n">c_uvw</span> <span class="o">=</span> <span class="p">[</span> <span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>

<span class="n">system</span><span class="p">,</span> <span class="n">transform</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">rotate</span><span class="p">([</span><span class="n">a_uvw</span><span class="p">,</span> <span class="n">b_uvw</span><span class="p">,</span> <span class="n">c_uvw</span><span class="p">],</span> <span class="n">return_transform</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Rotated system:&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
<span class="nb">print</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Transformation matrix:&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">transform</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Rotated system:
avect =  [ 7.422,  0.000,  0.000]
bvect =  [ 0.000,  5.248,  0.000]
cvect =  [ 0.000,  0.000,  4.285]
origin = [ 0.000,  0.000,  0.000]
natoms = 12
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   6.185 |   0.875 |   2.143
      1 |       1 |   2.474 |   0.875 |   4.285
      2 |       1 |   3.711 |   0.000 |   2.143
      3 |       1 |   3.711 |   2.624 |   2.143
      4 |       1 |   4.948 |   1.749 |   4.285
      5 |       1 |   4.948 |   4.373 |   4.285
      6 |       1 |   6.185 |   3.499 |   2.143
      7 |       1 |   0.000 |   0.000 |   0.000
      8 |       1 |   7.422 |   2.624 |   4.285
      9 |       1 |   1.237 |   1.749 |   2.143
     10 |       1 |   1.237 |   4.373 |   2.143
     11 |       1 |   2.474 |   3.499 |   4.285

Transformation matrix:
[[ 4.08248290e-01  4.08248290e-01 -8.16496581e-01]
 [ 5.77350269e-01  5.77350269e-01  5.77350269e-01]
 [ 7.07106781e-01 -7.07106781e-01  2.74677003e-16]]
</pre></div></div>
</div>
</div>
<div class="section" id="5.4.-supersize()">
<h3>5.4. supersize()<a class="headerlink" href="#5.4.-supersize()" title="Permalink to this headline">¶</a></h3>
<p>A supercell version of a system can be generated using the supersize() method.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>a_size</strong> (<em>int or tuple of int</em>) size multipliers for the system along the a box vector.</p></li>
<li><p><strong>b_size</strong> (<em>int or tuple of int</em>) size multipliers for the system along the b box vector.</p></li>
<li><p><strong>c_size</strong> (<em>int or tuple of int</em>) size multipliers for the system along the c box vector.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) a new System constructed by replicating the original along its box vectors.</p></li>
</ul>
<p>All three size terms can be positive or negative integers, or a tuple of (negative, positive) integers. Negative values replicate the system below the origin and positive values replicate the system above the origin.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[22]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Create 2x2x2 supercell</span>
<span class="c1"># new avect will start at the old origin</span>
<span class="n">a_size</span> <span class="o">=</span> <span class="mi">2</span>

<span class="c1"># new bvect will end at the old origin</span>
<span class="n">b_size</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span>

<span class="c1"># new cvect will be centered around the old origin</span>
<span class="n">c_size</span> <span class="o">=</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>

<span class="n">system</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">supersize</span><span class="p">(</span><span class="n">a_size</span><span class="p">,</span> <span class="n">b_size</span><span class="p">,</span> <span class="n">c_size</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 96
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   6.185 |  -9.622 |  -2.143
      1 |       1 |   2.474 |  -9.622 |  -0.000
      2 |       1 |   3.711 | -10.496 |  -2.143
      3 |       1 |   3.711 |  -7.872 |  -2.143
      4 |       1 |   4.948 |  -8.747 |  -0.000
      5 |       1 |   4.948 |  -6.123 |  -0.000
      6 |       1 |   6.185 |  -6.997 |  -2.143
      7 |       1 |   0.000 | -10.496 |  -4.285
      8 |       1 |   7.422 |  -7.872 |  -0.000
      9 |       1 |   1.237 |  -8.747 |  -2.143
     10 |       1 |   1.237 |  -6.123 |  -2.143
     11 |       1 |   2.474 |  -6.997 |   0.000
     12 |       1 |  13.607 |  -9.622 |  -2.143
     13 |       1 |   9.896 |  -9.622 |  -0.000
     14 |       1 |  11.133 | -10.496 |  -2.143
     15 |       1 |  11.133 |  -7.872 |  -2.143
     16 |       1 |  12.370 |  -8.747 |  -0.000
     17 |       1 |  12.370 |  -6.123 |  -0.000
     18 |       1 |  13.607 |  -6.997 |  -2.143
     19 |       1 |   7.422 | -10.496 |  -4.285
     20 |       1 |  14.844 |  -7.872 |  -0.000
     21 |       1 |   8.659 |  -8.747 |  -2.143
     22 |       1 |   8.659 |  -6.123 |  -2.143
     23 |       1 |   9.896 |  -6.997 |   0.000
     24 |       1 |   6.185 |  -4.373 |  -2.143
     25 |       1 |   2.474 |  -4.373 |  -0.000
     26 |       1 |   3.711 |  -5.248 |  -2.143
     27 |       1 |   3.711 |  -2.624 |  -2.143
     28 |       1 |   4.948 |  -3.499 |  -0.000
     29 |       1 |   4.948 |  -0.875 |  -0.000
     30 |       1 |   6.185 |  -1.749 |  -2.143
     31 |       1 |   0.000 |  -5.248 |  -4.285
     32 |       1 |   7.422 |  -2.624 |  -0.000
     33 |       1 |   1.237 |  -3.499 |  -2.143
     34 |       1 |   1.237 |  -0.875 |  -2.143
     35 |       1 |   2.474 |  -1.749 |   0.000
     36 |       1 |  13.607 |  -4.373 |  -2.143
     37 |       1 |   9.896 |  -4.373 |  -0.000
     38 |       1 |  11.133 |  -5.248 |  -2.143
     39 |       1 |  11.133 |  -2.624 |  -2.143
     40 |       1 |  12.370 |  -3.499 |  -0.000
     41 |       1 |  12.370 |  -0.875 |  -0.000
     42 |       1 |  13.607 |  -1.749 |  -2.143
     43 |       1 |   7.422 |  -5.248 |  -4.285
     44 |       1 |  14.844 |  -2.624 |  -0.000
     45 |       1 |   8.659 |  -3.499 |  -2.143
     46 |       1 |   8.659 |  -0.875 |  -2.143
     47 |       1 |   9.896 |  -1.749 |   0.000
     48 |       1 |   6.185 |  -9.622 |   2.143
     49 |       1 |   2.474 |  -9.622 |   4.285
     50 |       1 |   3.711 | -10.496 |   2.143
     51 |       1 |   3.711 |  -7.872 |   2.143
     52 |       1 |   4.948 |  -8.747 |   4.285
     53 |       1 |   4.948 |  -6.123 |   4.285
     54 |       1 |   6.185 |  -6.997 |   2.143
     55 |       1 |   0.000 | -10.496 |   0.000
     56 |       1 |   7.422 |  -7.872 |   4.285
     57 |       1 |   1.237 |  -8.747 |   2.143
     58 |       1 |   1.237 |  -6.123 |   2.143
     59 |       1 |   2.474 |  -6.997 |   4.285
     60 |       1 |  13.607 |  -9.622 |   2.143
     61 |       1 |   9.896 |  -9.622 |   4.285
     62 |       1 |  11.133 | -10.496 |   2.143
     63 |       1 |  11.133 |  -7.872 |   2.143
     64 |       1 |  12.370 |  -8.747 |   4.285
     65 |       1 |  12.370 |  -6.123 |   4.285
     66 |       1 |  13.607 |  -6.997 |   2.143
     67 |       1 |   7.422 | -10.496 |   0.000
     68 |       1 |  14.844 |  -7.872 |   4.285
     69 |       1 |   8.659 |  -8.747 |   2.143
     70 |       1 |   8.659 |  -6.123 |   2.143
     71 |       1 |   9.896 |  -6.997 |   4.285
     72 |       1 |   6.185 |  -4.373 |   2.143
     73 |       1 |   2.474 |  -4.373 |   4.285
     74 |       1 |   3.711 |  -5.248 |   2.143
     75 |       1 |   3.711 |  -2.624 |   2.143
     76 |       1 |   4.948 |  -3.499 |   4.285
     77 |       1 |   4.948 |  -0.875 |   4.285
     78 |       1 |   6.185 |  -1.749 |   2.143
     79 |       1 |   0.000 |  -5.248 |   0.000
     80 |       1 |   7.422 |  -2.624 |   4.285
     81 |       1 |   1.237 |  -3.499 |   2.143
     82 |       1 |   1.237 |  -0.875 |   2.143
     83 |       1 |   2.474 |  -1.749 |   4.285
     84 |       1 |  13.607 |  -4.373 |   2.143
     85 |       1 |   9.896 |  -4.373 |   4.285
     86 |       1 |  11.133 |  -5.248 |   2.143
     87 |       1 |  11.133 |  -2.624 |   2.143
     88 |       1 |  12.370 |  -3.499 |   4.285
     89 |       1 |  12.370 |  -0.875 |   4.285
     90 |       1 |  13.607 |  -1.749 |   2.143
     91 |       1 |   7.422 |  -5.248 |   0.000
     92 |       1 |  14.844 |  -2.624 |   4.285
     93 |       1 |   8.659 |  -3.499 |   2.143
     94 |       1 |   8.659 |  -0.875 |   2.143
     95 |       1 |   9.896 |  -1.749 |   4.285
</pre></div></div>
</div>
</div>
<div class="section" id="5.5.-atoms_ix">
<h3>5.5. atoms_ix<a class="headerlink" href="#5.5.-atoms_ix" title="Permalink to this headline">¶</a></h3>
<p><em>Added version 1.2.5</em></p>
<p>The atoms_ix extends the indexing functionality of the Atoms class to operate at the System level. This allows for systems containing a subset of the atoms to be easily generated.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[23]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Indexing directly on the system&#39;s atoms returns a new Atoms object</span>
<span class="n">subatoms</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="p">[[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">]]</span>
<span class="nb">print</span><span class="p">(</span><span class="n">subatoms</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   2.474 |  -9.622 |  -0.000
      1 |       1 |   3.711 | -10.496 |  -2.143
      2 |       1 |   0.000 | -10.496 |  -4.285
      3 |       1 |   7.422 |  -7.872 |  -0.000
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[24]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Using atoms_ix will return a new System containing the specified subset of atoms</span>
<span class="n">subsystem</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms_ix</span><span class="p">[[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">]]</span>
<span class="nb">print</span><span class="p">(</span><span class="n">subsystem</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 4
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   2.474 |  -9.622 |  -0.000
      1 |       1 |   3.711 | -10.496 |  -2.143
      2 |       1 |   0.000 | -10.496 |  -4.285
      3 |       1 |   7.422 |  -7.872 |  -0.000
</pre></div></div>
</div>
<p>Also, atoms_ix can be used to set (i.e. copy) a subset of atoms by passing in either a compatible Atoms or System object.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[25]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Copy atom 0 to atom 1 by passing a compatible Atoms object</span>
<span class="n">subsystem</span><span class="o">.</span><span class="n">atoms_ix</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">subsystem</span><span class="o">.</span><span class="n">atoms</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>

<span class="c1"># Copy atom 0 to atom 2 by passing a compatible System object</span>
<span class="n">subsystem</span><span class="o">.</span><span class="n">atoms_ix</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">subsystem</span><span class="o">.</span><span class="n">atoms_ix</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>

<span class="nb">print</span><span class="p">(</span><span class="n">subsystem</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 4
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   2.474 |  -9.622 |  -0.000
      1 |       1 |   2.474 |  -9.622 |  -0.000
      2 |       1 |   2.474 |  -9.622 |  -0.000
      3 |       1 |   7.422 |  -7.872 |  -0.000
</pre></div></div>
</div>
</div>
<div class="section" id="5.6.-atoms_extend()">
<h3>5.6. atoms_extend()<a class="headerlink" href="#5.6.-atoms_extend()" title="Permalink to this headline">¶</a></h3>
<p><em>Added version 1.2.8</em></p>
<p>The atoms_extend() method allows the extend() method of the Atoms class to operate at the System level. This allows for new Systems to be generated by copying the current System object with additional atoms.</p>
<p>Parameters - <strong>value</strong> (<em>atomman.Atoms or int</em>) An int value will result in the atoms object being extended by that number of atoms, with all per-atom properties having default values (atype = 1, everything else = 0). For an Atoms value, the current atoms list will be extended by the correct number of atoms and all per-atom properties in value will be copied over. Any properties defined in one Atoms object and not the other will be set to default values. - <strong>scale</strong> (<em>bool, optional</em>) Flag
indicating if position values in a supplied Atoms value are to be taken as absolute Cartesian (False, default) or in scaled box relative units (True). - <strong>symbols</strong> (<em>tuple, list or None, optional</em>) Allows for the system’s symbols list to be updated. If not given, will use the current object’s symbols. - <strong>safecopy</strong> (<em>bool, optional</em>) Flag indicating if values are to be copied before setting. If False (default), underlying objects may be shared between the new system and the current system and
input parameters. If True, atoms and box will be deepcopied before setting. Note that safecopy=True may be considerably slower for large numbers of atoms and/or properties.</p>
<p>Returns - (<em>atomman.System</em>) A new System object with Atoms extended to contain all atoms and properties of the current object plus the additional atoms. The cuurent System object’s box and pbc (and symbols if not specified) will be copied over.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[26]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Add two empty atoms to subsystem</span>
<span class="nb">print</span><span class="p">(</span><span class="n">subsystem</span><span class="o">.</span><span class="n">atoms_extend</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 6
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   2.474 |  -9.622 |  -0.000
      1 |       1 |   2.474 |  -9.622 |  -0.000
      2 |       1 |   2.474 |  -9.622 |  -0.000
      3 |       1 |   7.422 |  -7.872 |  -0.000
      4 |       1 |   0.000 |   0.000 |   0.000
      5 |       1 |   0.000 |   0.000 |   0.000
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[27]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># double the atoms in subsystem by copying them</span>
<span class="nb">print</span><span class="p">(</span><span class="n">subsystem</span><span class="o">.</span><span class="n">atoms_extend</span><span class="p">(</span><span class="n">subsystem</span><span class="o">.</span><span class="n">atoms</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 8
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   2.474 |  -9.622 |  -0.000
      1 |       1 |   2.474 |  -9.622 |  -0.000
      2 |       1 |   2.474 |  -9.622 |  -0.000
      3 |       1 |   7.422 |  -7.872 |  -0.000
      4 |       1 |   2.474 |  -9.622 |  -0.000
      5 |       1 |   2.474 |  -9.622 |  -0.000
      6 |       1 |   2.474 |  -9.622 |  -0.000
      7 |       1 |   7.422 |  -7.872 |  -0.000
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="6.-Built-in-analysis-tools">
<h2>6. Built-in analysis tools<a class="headerlink" href="#6.-Built-in-analysis-tools" title="Permalink to this headline">¶</a></h2>
<div class="section" id="6.1.-dvect()-and-dmag()">
<h3>6.1. dvect() and dmag()<a class="headerlink" href="#6.1.-dvect()-and-dmag()" title="Permalink to this headline">¶</a></h3>
<p>The dvect() and dmag() methods calculate the shortest vector difference between two positions, accounting for the system’s periodic boundaries. dvect returns the vector(s), while dmag returns the magnitudes of the vectors.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>pos_0</strong> (<em>numpy.ndarray or index</em>) Absolute Cartesian vector position(s) to use as reference point(s). If the value can be used as an index, then self.atoms.pos[pos_0] is taken.</p></li>
<li><p><strong>pos_1</strong> (<em>numpy.ndarray or index</em>) Absolute Cartesian vector position(s) to find relative to pos_0. If the value can be used as an index, then self.atoms.pos[pos_1] is taken.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[28]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Show simple position difference vector between atoms 7 and 12</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.atoms.pos[7] - system.atoms.pos[12] -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">-</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">[</span><span class="mi">12</span><span class="p">])</span>

<span class="c1"># Show shortest periodic distance vector between atoms 7 and 12</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.dvect(12, 7) -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">dvect</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">7</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
system.atoms.pos[7] - system.atoms.pos[12] -&gt;
[-13.60691552  -0.87468566  -2.14253355]
system.dvect(12, 7) -&gt;
[ 1.23699232 -0.87468566 -2.14253355]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[29]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Compute the shortest periodic distance between atom 34 and all atoms</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;system.dmag(34, system.atoms.pos) -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">dmag</span><span class="p">(</span><span class="mi">34</span><span class="p">,</span> <span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">pos</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
system.dmag(34, system.atoms.pos) -&gt;
[ 5.24811395  3.03        2.62405697  4.28506709  5.02468656  6.77528597
  6.6037319   2.62405697  7.42195392  2.62405697  5.24811395  5.02468656
  3.03        6.77528597  5.02468656  6.06        5.02468656  6.77528597
  5.02468656  6.6037319   4.28506709  7.87217092  9.09        7.87217092
  6.06        4.28506709  5.02468656  3.03        5.02468656  4.28506709
  5.02468656  5.02468656  6.77528597  2.62405697  0.          2.62405697
  4.28506709  7.42195392  6.6037319   5.24811395  5.02468656  4.28506709
  2.62405697  7.87217092  3.03        7.87217092  7.42195392  6.6037319
  6.77528597  3.03        5.02468656  6.06        5.02468656  6.77528597
  7.87217092  2.62405697  7.42195392  5.02468656  6.77528597  5.02468656
  5.24811395  6.77528597  6.6037319   7.42195392  5.02468656  6.77528597
  6.6037319   6.6037319   4.28506709  8.96286087 10.04937311  7.87217092
  7.42195392  4.28506709  6.6037319   5.24811395  5.02468656  4.28506709
  6.6037319   5.02468656  6.77528597  5.02468656  4.28506709  2.62405697
  6.06        7.42195392  7.87217092  6.77528597  5.02468656  4.28506709
  5.02468656  7.87217092  3.03        8.96286087  8.57013419  6.6037319 ]
</pre></div></div>
</div>
</div>
<div class="section" id="6.2.-neighborlist()">
<h3>6.2. neighborlist()<a class="headerlink" href="#6.2.-neighborlist()" title="Permalink to this headline">¶</a></h3>
<p>The neighborlist() method returns a <a class="reference external" href="3.2._NeighborList_class.html">NeighborList class</a> object for the system.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>cutoff</strong> (<em>float, optional</em>) Radial cutoff distance for identifying neighbors. Must be given if model is not given.</p></li>
<li><p><strong>model</strong> (<em>str or file-like object, optional</em>) Gives the file path or content to load. If given, initialsize is the only other allowed parameter.</p></li>
<li><p><strong>initialsize</strong> (<em>int, optional</em>) The number of neighbor positions to initially assign to each atom. Default value is 20.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[30]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Compute NeighborList for system</span>
<span class="n">cutoff</span> <span class="o">=</span> <span class="mf">0.90</span> <span class="o">*</span><span class="n">alat</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Computing neighbor list using cutoff of&#39;</span><span class="p">,</span> <span class="n">cutoff</span><span class="p">,</span> <span class="s1">&#39;angstrom&#39;</span><span class="p">)</span>
<span class="n">neighbors</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">neighborlist</span><span class="p">(</span><span class="n">cutoff</span><span class="o">=</span><span class="n">cutoff</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Computing neighbor list using cutoff of 2.727 angstrom
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[31]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Show each atom&#39;s coordination</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;neighbors.coord -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">neighbors</span><span class="o">.</span><span class="n">coord</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
neighbors.coord -&gt;
[8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[32]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Show identified neighbors for atom 4</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;neighbors[4] -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">neighbors</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
neighbors[4] -&gt;
[ 0  1  3  5  8 29 48 51]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[33]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Show that all identified neighbors are within the cutoff of atom 4</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;np.linalg.norm(system.dvect(4, neighbors[4]), axis=1) -&gt;&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">system</span><span class="o">.</span><span class="n">dvect</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="n">neighbors</span><span class="p">[</span><span class="mi">4</span><span class="p">]),</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
np.linalg.norm(system.dvect(4, neighbors[4]), axis=1) -&gt;
[2.62405697 2.62405697 2.62405697 2.62405697 2.62405697 2.62405697
 2.62405697 2.62405697]
</pre></div></div>
</div>
</div>
<div class="section" id="6.3.-r0()">
<h3>6.3. r0()<a class="headerlink" href="#6.3.-r0()" title="Permalink to this headline">¶</a></h3>
<p><em>added version 1.3.2</em></p>
<p>The r0() method identifies the shortest interatomic spacing for the system.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>neighborlist</strong> (<em>NeighborList, optional</em>) A pre-computed NeighborList for the system. If not given, a new NeighborList will be used based on a cutoff distance related to the smallest dmag between atom 0 and the rest of the system’s atoms.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[34]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">system</span><span class="o">.</span><span class="n">r0</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[34]:
</pre></div>
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
2.624056973466846
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="7.-model()-and-dump()">
<h2>7. model() and dump()<a class="headerlink" href="#7.-model()-and-dump()" title="Permalink to this headline">¶</a></h2>
<p><em>model() added version 1.2.7</em></p>
<p>A JSON/XML equivalent data model representation of the Systems object can be generated using the model() method.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>box_unit</strong> (<em>str, optional</em>) Length unit to use for the box. Default value is ‘angstrom’.</p></li>
<li><p><strong>symbols</strong> (<em>list, optional</em>) List of atom-model symbols corresponding to the atom types. If not given, will use system.symbols.</p></li>
<li><p><strong>prop_name</strong> (<em>list, optional</em>) The Atoms properties to include. If neither prop_name nor prop_unit are given, all system properties will be included.</p></li>
<li><p><strong>unit</strong> (<em>list, optional</em>) Lists the units for each prop_name as stored in the table. For a value of None, no conversion will be performed for that property. For a value of ‘scaled’, the corresponding table values will be taken in box-scaled units. If neither unit nor prop_units given, pos will be given in Angstroms and all other values will not be converted.</p></li>
<li><p><strong>prop_unit</strong> (<em>dict, optional</em>) Dictionary where the keys are the property keys to include, and the values are units to use. If neither unit nor prop_units given, pos will be given in Angstroms and all other values will not be converted.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>DataModelDict.DataModelDict</em>) A JSON/XML data model for the current Systems object.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[35]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">model</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">model</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">json</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
{&#34;atomic-system&#34;: {&#34;box&#34;: {&#34;avect&#34;: {&#34;value&#34;: [14.843907841266057, 0.0, 0.0]}, &#34;bvect&#34;: {&#34;value&#34;: [0.0, 10.496227893867395, 0.0]}, &#34;cvect&#34;: {&#34;value&#34;: [0.0, 0.0, 8.570134187980956]}, &#34;origin&#34;: {&#34;value&#34;: [0.0, -10.496227893867395, -4.285067093990478]}}, &#34;periodic-boundary-condition&#34;: [true, true, true], &#34;atom-type-symbol&#34;: &#34;V&#34;, &#34;atoms&#34;: {&#34;natoms&#34;: 96, &#34;property&#34;: [{&#34;name&#34;: &#34;atype&#34;, &#34;data&#34;: {&#34;value&#34;: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}}, {&#34;name&#34;: &#34;pos&#34;, &#34;data&#34;: {&#34;value&#34;: [6.184961600527525, -9.621542236045112, -2.1425335469952396, 2.473984640211009, -9.621542236045114, -8.881784197001252e-16, 3.7109769603165144, -10.496227893867395, -2.1425335469952396, 3.7109769603165144, -7.872170920400547, -2.142533546995239, 4.947969280422018, -8.746856578222829, -8.881784197001252e-16, 4.9479692804220194, -6.12279960475598, -8.881784197001252e-16, 6.184961600527524, -6.9974852625782615, -2.142533546995239, 0.0, -10.496227893867395, -4.285067093990478, 7.421953920633027, -7.872170920400547, -8.881784197001252e-16, 1.2369923201055044, -8.746856578222829, -2.1425335469952396, 1.2369923201055035, -6.12279960475598, -2.142533546995239, 2.473984640211009, -6.997485262578263, 0.0, 13.606915521160554, -9.621542236045112, -2.1425335469952396, 9.895938560844037, -9.621542236045114, -8.881784197001252e-16, 11.132930880949543, -10.496227893867395, -2.1425335469952396, 11.132930880949543, -7.872170920400547, -2.142533546995239, 12.369923201055046, -8.746856578222829, -8.881784197001252e-16, 12.369923201055048, -6.12279960475598, -8.881784197001252e-16, 13.606915521160554, -6.9974852625782615, -2.142533546995239, 7.421953920633029, -10.496227893867395, -4.285067093990478, 14.843907841266056, -7.872170920400547, -8.881784197001252e-16, 8.658946240738532, -8.746856578222829, -2.1425335469952396, 8.658946240738532, -6.12279960475598, -2.142533546995239, 9.895938560844037, -6.997485262578263, 0.0, 6.184961600527525, -4.373428289111415, -2.1425335469952396, 2.473984640211009, -4.373428289111415, -8.881784197001252e-16, 3.7109769603165144, -5.248113946933698, -2.1425335469952396, 3.7109769603165144, -2.624056973466849, -2.142533546995239, 4.947969280422018, -3.498742631289132, -8.881784197001252e-16, 4.9479692804220194, -0.8746856578222815, -8.881784197001252e-16, 6.184961600527524, -1.7493713156445647, -2.142533546995239, 0.0, -5.248113946933698, -4.285067093990478, 7.421953920633027, -2.624056973466849, -8.881784197001252e-16, 1.2369923201055044, -3.498742631289131, -2.1425335469952396, 1.2369923201055035, -0.8746856578222815, -2.142533546995239, 2.473984640211009, -1.7493713156445647, 0.0, 13.606915521160554, -4.373428289111415, -2.1425335469952396, 9.895938560844037, -4.373428289111415, -8.881784197001252e-16, 11.132930880949543, -5.248113946933698, -2.1425335469952396, 11.132930880949543, -2.624056973466849, -2.142533546995239, 12.369923201055046, -3.498742631289132, -8.881784197001252e-16, 12.369923201055048, -0.8746856578222815, -8.881784197001252e-16, 13.606915521160554, -1.7493713156445647, -2.142533546995239, 7.421953920633029, -5.248113946933698, -4.285067093990478, 14.843907841266056, -2.624056973466849, -8.881784197001252e-16, 8.658946240738532, -3.498742631289131, -2.1425335469952396, 8.658946240738532, -0.8746856578222815, -2.142533546995239, 9.895938560844037, -1.7493713156445647, 0.0, 6.184961600527525, -9.621542236045112, 2.1425335469952396, 2.473984640211009, -9.621542236045114, 4.2850670939904765, 3.7109769603165144, -10.496227893867395, 2.1425335469952396, 3.7109769603165144, -7.872170920400547, 2.1425335469952396, 4.947969280422018, -8.746856578222829, 4.2850670939904765, 4.9479692804220194, -6.12279960475598, 4.2850670939904765, 6.184961600527524, -6.9974852625782615, 2.1425335469952396, 0.0, -10.496227893867395, 0.0, 7.421953920633027, -7.872170920400547, 4.2850670939904765, 1.2369923201055044, -8.746856578222829, 2.1425335469952396, 1.2369923201055035, -6.12279960475598, 2.1425335469952396, 2.473984640211009, -6.997485262578263, 4.285067093990478, 13.606915521160554, -9.621542236045112, 2.1425335469952396, 9.895938560844037, -9.621542236045114, 4.2850670939904765, 11.132930880949543, -10.496227893867395, 2.1425335469952396, 11.132930880949543, -7.872170920400547, 2.1425335469952396, 12.369923201055046, -8.746856578222829, 4.2850670939904765, 12.369923201055048, -6.12279960475598, 4.2850670939904765, 13.606915521160554, -6.9974852625782615, 2.1425335469952396, 7.421953920633029, -10.496227893867395, 0.0, 14.843907841266056, -7.872170920400547, 4.2850670939904765, 8.658946240738532, -8.746856578222829, 2.1425335469952396, 8.658946240738532, -6.12279960475598, 2.1425335469952396, 9.895938560844037, -6.997485262578263, 4.285067093990478, 6.184961600527525, -4.373428289111415, 2.1425335469952396, 2.473984640211009, -4.373428289111415, 4.2850670939904765, 3.7109769603165144, -5.248113946933698, 2.1425335469952396, 3.7109769603165144, -2.624056973466849, 2.1425335469952396, 4.947969280422018, -3.498742631289132, 4.2850670939904765, 4.9479692804220194, -0.8746856578222815, 4.2850670939904765, 6.184961600527524, -1.7493713156445647, 2.1425335469952396, 0.0, -5.248113946933698, 0.0, 7.421953920633027, -2.624056973466849, 4.2850670939904765, 1.2369923201055044, -3.498742631289131, 2.1425335469952396, 1.2369923201055035, -0.8746856578222815, 2.1425335469952396, 2.473984640211009, -1.7493713156445647, 4.285067093990478, 13.606915521160554, -4.373428289111415, 2.1425335469952396, 9.895938560844037, -4.373428289111415, 4.2850670939904765, 11.132930880949543, -5.248113946933698, 2.1425335469952396, 11.132930880949543, -2.624056973466849, 2.1425335469952396, 12.369923201055046, -3.498742631289132, 4.2850670939904765, 12.369923201055048, -0.8746856578222815, 4.2850670939904765, 13.606915521160554, -1.7493713156445647, 2.1425335469952396, 7.421953920633029, -5.248113946933698, 0.0, 14.843907841266056, -2.624056973466849, 4.2850670939904765, 8.658946240738532, -3.498742631289131, 2.1425335469952396, 8.658946240738532, -0.8746856578222815, 2.1425335469952396, 9.895938560844037, -1.7493713156445647, 4.285067093990478], &#34;shape&#34;: [96, 3], &#34;unit&#34;: &#34;angstrom&#34;}}]}}}
</pre></div></div>
</div>
<p>Any stored model information can then be reloaded in as a new System object by passing the ‘model’ parameter to the class initializer.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[36]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="n">am</span><span class="o">.</span><span class="n">System</span><span class="p">(</span><span class="n">model</span><span class="o">=</span><span class="n">model</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [14.844,  0.000,  0.000]
bvect =  [ 0.000, 10.496,  0.000]
cvect =  [ 0.000,  0.000,  8.570]
origin = [ 0.000, -10.496, -4.285]
natoms = 96
natypes = 1
symbols = (&#39;V&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   6.185 |  -9.622 |  -2.143
      1 |       1 |   2.474 |  -9.622 |  -0.000
      2 |       1 |   3.711 | -10.496 |  -2.143
      3 |       1 |   3.711 |  -7.872 |  -2.143
      4 |       1 |   4.948 |  -8.747 |  -0.000
      5 |       1 |   4.948 |  -6.123 |  -0.000
      6 |       1 |   6.185 |  -6.997 |  -2.143
      7 |       1 |   0.000 | -10.496 |  -4.285
      8 |       1 |   7.422 |  -7.872 |  -0.000
      9 |       1 |   1.237 |  -8.747 |  -2.143
     10 |       1 |   1.237 |  -6.123 |  -2.143
     11 |       1 |   2.474 |  -6.997 |   0.000
     12 |       1 |  13.607 |  -9.622 |  -2.143
     13 |       1 |   9.896 |  -9.622 |  -0.000
     14 |       1 |  11.133 | -10.496 |  -2.143
     15 |       1 |  11.133 |  -7.872 |  -2.143
     16 |       1 |  12.370 |  -8.747 |  -0.000
     17 |       1 |  12.370 |  -6.123 |  -0.000
     18 |       1 |  13.607 |  -6.997 |  -2.143
     19 |       1 |   7.422 | -10.496 |  -4.285
     20 |       1 |  14.844 |  -7.872 |  -0.000
     21 |       1 |   8.659 |  -8.747 |  -2.143
     22 |       1 |   8.659 |  -6.123 |  -2.143
     23 |       1 |   9.896 |  -6.997 |   0.000
     24 |       1 |   6.185 |  -4.373 |  -2.143
     25 |       1 |   2.474 |  -4.373 |  -0.000
     26 |       1 |   3.711 |  -5.248 |  -2.143
     27 |       1 |   3.711 |  -2.624 |  -2.143
     28 |       1 |   4.948 |  -3.499 |  -0.000
     29 |       1 |   4.948 |  -0.875 |  -0.000
     30 |       1 |   6.185 |  -1.749 |  -2.143
     31 |       1 |   0.000 |  -5.248 |  -4.285
     32 |       1 |   7.422 |  -2.624 |  -0.000
     33 |       1 |   1.237 |  -3.499 |  -2.143
     34 |       1 |   1.237 |  -0.875 |  -2.143
     35 |       1 |   2.474 |  -1.749 |   0.000
     36 |       1 |  13.607 |  -4.373 |  -2.143
     37 |       1 |   9.896 |  -4.373 |  -0.000
     38 |       1 |  11.133 |  -5.248 |  -2.143
     39 |       1 |  11.133 |  -2.624 |  -2.143
     40 |       1 |  12.370 |  -3.499 |  -0.000
     41 |       1 |  12.370 |  -0.875 |  -0.000
     42 |       1 |  13.607 |  -1.749 |  -2.143
     43 |       1 |   7.422 |  -5.248 |  -4.285
     44 |       1 |  14.844 |  -2.624 |  -0.000
     45 |       1 |   8.659 |  -3.499 |  -2.143
     46 |       1 |   8.659 |  -0.875 |  -2.143
     47 |       1 |   9.896 |  -1.749 |   0.000
     48 |       1 |   6.185 |  -9.622 |   2.143
     49 |       1 |   2.474 |  -9.622 |   4.285
     50 |       1 |   3.711 | -10.496 |   2.143
     51 |       1 |   3.711 |  -7.872 |   2.143
     52 |       1 |   4.948 |  -8.747 |   4.285
     53 |       1 |   4.948 |  -6.123 |   4.285
     54 |       1 |   6.185 |  -6.997 |   2.143
     55 |       1 |   0.000 | -10.496 |   0.000
     56 |       1 |   7.422 |  -7.872 |   4.285
     57 |       1 |   1.237 |  -8.747 |   2.143
     58 |       1 |   1.237 |  -6.123 |   2.143
     59 |       1 |   2.474 |  -6.997 |   4.285
     60 |       1 |  13.607 |  -9.622 |   2.143
     61 |       1 |   9.896 |  -9.622 |   4.285
     62 |       1 |  11.133 | -10.496 |   2.143
     63 |       1 |  11.133 |  -7.872 |   2.143
     64 |       1 |  12.370 |  -8.747 |   4.285
     65 |       1 |  12.370 |  -6.123 |   4.285
     66 |       1 |  13.607 |  -6.997 |   2.143
     67 |       1 |   7.422 | -10.496 |   0.000
     68 |       1 |  14.844 |  -7.872 |   4.285
     69 |       1 |   8.659 |  -8.747 |   2.143
     70 |       1 |   8.659 |  -6.123 |   2.143
     71 |       1 |   9.896 |  -6.997 |   4.285
     72 |       1 |   6.185 |  -4.373 |   2.143
     73 |       1 |   2.474 |  -4.373 |   4.285
     74 |       1 |   3.711 |  -5.248 |   2.143
     75 |       1 |   3.711 |  -2.624 |   2.143
     76 |       1 |   4.948 |  -3.499 |   4.285
     77 |       1 |   4.948 |  -0.875 |   4.285
     78 |       1 |   6.185 |  -1.749 |   2.143
     79 |       1 |   0.000 |  -5.248 |   0.000
     80 |       1 |   7.422 |  -2.624 |   4.285
     81 |       1 |   1.237 |  -3.499 |   2.143
     82 |       1 |   1.237 |  -0.875 |   2.143
     83 |       1 |   2.474 |  -1.749 |   4.285
     84 |       1 |  13.607 |  -4.373 |   2.143
     85 |       1 |   9.896 |  -4.373 |   4.285
     86 |       1 |  11.133 |  -5.248 |   2.143
     87 |       1 |  11.133 |  -2.624 |   2.143
     88 |       1 |  12.370 |  -3.499 |   4.285
     89 |       1 |  12.370 |  -0.875 |   4.285
     90 |       1 |  13.607 |  -1.749 |   2.143
     91 |       1 |   7.422 |  -5.248 |   0.000
     92 |       1 |  14.844 |  -2.624 |   4.285
     93 |       1 |   8.659 |  -3.499 |   2.143
     94 |       1 |   8.659 |  -0.875 |   2.143
     95 |       1 |   9.896 |  -1.749 |   4.285
</pre></div></div>
</div>
<p>The system can also be exported to a number of other formats using the dump() method.</p>
<p>See the <a class="reference external" href="1.4._Load_and_dump_conversions.html">1.4. Load and dump conversions Jupyter Notebook</a> for more detailed information on the different styles and options.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[37]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">poscar</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;poscar&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">poscar</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>

1.0000000000000e+00
1.4843907841266e+01 0.0000000000000e+00 0.0000000000000e+00
0.0000000000000e+00 1.0496227893867e+01 0.0000000000000e+00
0.0000000000000e+00 0.0000000000000e+00 8.5701341879810e+00
V
96
direct
4.1666666666667e-01 8.3333333333333e-02 2.5000000000000e-01
1.6666666666667e-01 8.3333333333333e-02 5.0000000000000e-01
2.5000000000000e-01 0.0000000000000e+00 2.5000000000000e-01
2.5000000000000e-01 2.5000000000000e-01 2.5000000000000e-01
3.3333333333333e-01 1.6666666666667e-01 5.0000000000000e-01
3.3333333333333e-01 4.1666666666667e-01 5.0000000000000e-01
4.1666666666667e-01 3.3333333333333e-01 2.5000000000000e-01
0.0000000000000e+00 0.0000000000000e+00 0.0000000000000e+00
5.0000000000000e-01 2.5000000000000e-01 5.0000000000000e-01
8.3333333333333e-02 1.6666666666667e-01 2.5000000000000e-01
8.3333333333333e-02 4.1666666666667e-01 2.5000000000000e-01
1.6666666666667e-01 3.3333333333333e-01 5.0000000000000e-01
9.1666666666667e-01 8.3333333333333e-02 2.5000000000000e-01
6.6666666666667e-01 8.3333333333333e-02 5.0000000000000e-01
7.5000000000000e-01 0.0000000000000e+00 2.5000000000000e-01
7.5000000000000e-01 2.5000000000000e-01 2.5000000000000e-01
8.3333333333333e-01 1.6666666666667e-01 5.0000000000000e-01
8.3333333333333e-01 4.1666666666667e-01 5.0000000000000e-01
9.1666666666667e-01 3.3333333333333e-01 2.5000000000000e-01
5.0000000000000e-01 0.0000000000000e+00 0.0000000000000e+00
1.0000000000000e+00 2.5000000000000e-01 5.0000000000000e-01
5.8333333333333e-01 1.6666666666667e-01 2.5000000000000e-01
5.8333333333333e-01 4.1666666666667e-01 2.5000000000000e-01
6.6666666666667e-01 3.3333333333333e-01 5.0000000000000e-01
4.1666666666667e-01 5.8333333333333e-01 2.5000000000000e-01
1.6666666666667e-01 5.8333333333333e-01 5.0000000000000e-01
2.5000000000000e-01 5.0000000000000e-01 2.5000000000000e-01
2.5000000000000e-01 7.5000000000000e-01 2.5000000000000e-01
3.3333333333333e-01 6.6666666666667e-01 5.0000000000000e-01
3.3333333333333e-01 9.1666666666667e-01 5.0000000000000e-01
4.1666666666667e-01 8.3333333333333e-01 2.5000000000000e-01
0.0000000000000e+00 5.0000000000000e-01 0.0000000000000e+00
5.0000000000000e-01 7.5000000000000e-01 5.0000000000000e-01
8.3333333333333e-02 6.6666666666667e-01 2.5000000000000e-01
8.3333333333333e-02 9.1666666666667e-01 2.5000000000000e-01
1.6666666666667e-01 8.3333333333333e-01 5.0000000000000e-01
9.1666666666667e-01 5.8333333333333e-01 2.5000000000000e-01
6.6666666666667e-01 5.8333333333333e-01 5.0000000000000e-01
7.5000000000000e-01 5.0000000000000e-01 2.5000000000000e-01
7.5000000000000e-01 7.5000000000000e-01 2.5000000000000e-01
8.3333333333333e-01 6.6666666666667e-01 5.0000000000000e-01
8.3333333333333e-01 9.1666666666667e-01 5.0000000000000e-01
9.1666666666667e-01 8.3333333333333e-01 2.5000000000000e-01
5.0000000000000e-01 5.0000000000000e-01 0.0000000000000e+00
1.0000000000000e+00 7.5000000000000e-01 5.0000000000000e-01
5.8333333333333e-01 6.6666666666667e-01 2.5000000000000e-01
5.8333333333333e-01 9.1666666666667e-01 2.5000000000000e-01
6.6666666666667e-01 8.3333333333333e-01 5.0000000000000e-01
4.1666666666667e-01 8.3333333333333e-02 7.5000000000000e-01
1.6666666666667e-01 8.3333333333333e-02 1.0000000000000e+00
2.5000000000000e-01 0.0000000000000e+00 7.5000000000000e-01
2.5000000000000e-01 2.5000000000000e-01 7.5000000000000e-01
3.3333333333333e-01 1.6666666666667e-01 1.0000000000000e+00
3.3333333333333e-01 4.1666666666667e-01 1.0000000000000e+00
4.1666666666667e-01 3.3333333333333e-01 7.5000000000000e-01
0.0000000000000e+00 0.0000000000000e+00 5.0000000000000e-01
5.0000000000000e-01 2.5000000000000e-01 1.0000000000000e+00
8.3333333333333e-02 1.6666666666667e-01 7.5000000000000e-01
8.3333333333333e-02 4.1666666666667e-01 7.5000000000000e-01
1.6666666666667e-01 3.3333333333333e-01 1.0000000000000e+00
9.1666666666667e-01 8.3333333333333e-02 7.5000000000000e-01
6.6666666666667e-01 8.3333333333333e-02 1.0000000000000e+00
7.5000000000000e-01 0.0000000000000e+00 7.5000000000000e-01
7.5000000000000e-01 2.5000000000000e-01 7.5000000000000e-01
8.3333333333333e-01 1.6666666666667e-01 1.0000000000000e+00
8.3333333333333e-01 4.1666666666667e-01 1.0000000000000e+00
9.1666666666667e-01 3.3333333333333e-01 7.5000000000000e-01
5.0000000000000e-01 0.0000000000000e+00 5.0000000000000e-01
1.0000000000000e+00 2.5000000000000e-01 1.0000000000000e+00
5.8333333333333e-01 1.6666666666667e-01 7.5000000000000e-01
5.8333333333333e-01 4.1666666666667e-01 7.5000000000000e-01
6.6666666666667e-01 3.3333333333333e-01 1.0000000000000e+00
4.1666666666667e-01 5.8333333333333e-01 7.5000000000000e-01
1.6666666666667e-01 5.8333333333333e-01 1.0000000000000e+00
2.5000000000000e-01 5.0000000000000e-01 7.5000000000000e-01
2.5000000000000e-01 7.5000000000000e-01 7.5000000000000e-01
3.3333333333333e-01 6.6666666666667e-01 1.0000000000000e+00
3.3333333333333e-01 9.1666666666667e-01 1.0000000000000e+00
4.1666666666667e-01 8.3333333333333e-01 7.5000000000000e-01
0.0000000000000e+00 5.0000000000000e-01 5.0000000000000e-01
5.0000000000000e-01 7.5000000000000e-01 1.0000000000000e+00
8.3333333333333e-02 6.6666666666667e-01 7.5000000000000e-01
8.3333333333333e-02 9.1666666666667e-01 7.5000000000000e-01
1.6666666666667e-01 8.3333333333333e-01 1.0000000000000e+00
9.1666666666667e-01 5.8333333333333e-01 7.5000000000000e-01
6.6666666666667e-01 5.8333333333333e-01 1.0000000000000e+00
7.5000000000000e-01 5.0000000000000e-01 7.5000000000000e-01
7.5000000000000e-01 7.5000000000000e-01 7.5000000000000e-01
8.3333333333333e-01 6.6666666666667e-01 1.0000000000000e+00
8.3333333333333e-01 9.1666666666667e-01 1.0000000000000e+00
9.1666666666667e-01 8.3333333333333e-01 7.5000000000000e-01
5.0000000000000e-01 5.0000000000000e-01 5.0000000000000e-01
1.0000000000000e+00 7.5000000000000e-01 1.0000000000000e+00
5.8333333333333e-01 6.6666666666667e-01 7.5000000000000e-01
5.8333333333333e-01 9.1666666666667e-01 7.5000000000000e-01
6.6666666666667e-01 8.3333333333333e-01 1.0000000000000e+00
</pre></div></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Introduction to atomman: System class</a><ul>
<li><a class="reference internal" href="#1.-Introduction">1. Introduction</a></li>
<li><a class="reference internal" href="#2.-Basics">2. Basics</a><ul>
<li><a class="reference internal" href="#2.1.-Initialization-Options">2.1. Initialization Options</a></li>
</ul>
</li>
<li><a class="reference internal" href="#3.-Built-in-Attributes">3. Built-in Attributes</a></li>
<li><a class="reference internal" href="#4.-Scaling-Additions">4. Scaling Additions</a><ul>
<li><a class="reference internal" href="#4.1.-scale()-and-unscale()">4.1. scale() and unscale()</a></li>
<li><a class="reference internal" href="#4.2.-atoms_prop()">4.2. atoms_prop()</a></li>
<li><a class="reference internal" href="#4.3.-atoms_df()">4.3. atoms_df()</a></li>
<li><a class="reference internal" href="#4.4.-box_set()">4.4. box_set()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#5.-Built-in-manipulations">5. Built-in manipulations</a><ul>
<li><a class="reference internal" href="#5.1.-wrap()">5.1. wrap()</a></li>
<li><a class="reference internal" href="#5.2.-normalize()">5.2. normalize()</a></li>
<li><a class="reference internal" href="#5.3.-rotate()">5.3. rotate()</a></li>
<li><a class="reference internal" href="#5.4.-supersize()">5.4. supersize()</a></li>
<li><a class="reference internal" href="#5.5.-atoms_ix">5.5. atoms_ix</a></li>
<li><a class="reference internal" href="#5.6.-atoms_extend()">5.6. atoms_extend()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#6.-Built-in-analysis-tools">6. Built-in analysis tools</a><ul>
<li><a class="reference internal" href="#6.1.-dvect()-and-dmag()">6.1. dvect() and dmag()</a></li>
<li><a class="reference internal" href="#6.2.-neighborlist()">6.2. neighborlist()</a></li>
<li><a class="reference internal" href="#6.3.-r0()">6.3. r0()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#7.-model()-and-dump()">7. model() and dump()</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="1.2._Atoms_class.html"
                        title="previous chapter">Introduction to atomman: Atoms class</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="1.4._Load_and_dump_conversions.html"
                        title="next chapter">Introduction to atomman: Load and dump conversions</a></p>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="1.4._Load_and_dump_conversions.html" title="Introduction to atomman: Load and dump conversions"
             >next</a> |</li>
        <li class="right" >
          <a href="1.2._Atoms_class.html" title="Introduction to atomman: Atoms class"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
    </div>
  </body>
</html>